Spectral Subtration

In this notebook we are going to perform audio denoising by spectral subtraction. The idea behind spectral subtraction is:

You will make heavy use of the helper class a3py.STFT, which has been provided for you.

Input Audio

Let's start off by opening an audio file. I've provided an example audio file, ./noisyhellocs6682, for you to testt on, but I want you to hand in the result of spectral subtraction on your own audio for your submission. Specifically, use the notebook ./MySpectralSubtraction.ipynb to generate what you will be handing in.

Estimating The Noise Spectrum

To estimate the noise spectrum, we want to pick out a span of time from the original audio that only has background noise. An easy way to do this is to look at the spectrogram for a start and end time with no speech in between.

When you run this on your own sound, be sure to record a few seconds of background noise for this purpose.

Clipping our noise sample

In our sample audio, 8.5s-12s is just background noise, so we will use that. We can use the helper function audio.GetClip(start, end) to clip our audio to a new Audio object.

Your Code Goes Here!

Complete the following two functions to implement spectral subtraction. My implementation is 5 lines of code---yours may be more than that, but try not to make it too complicated.

Run things on your own audio!

Run the same process below on some audio that you record.

What to turn in

Run this entire notebook when you have completed it (with your implementation and denoised audio results included). Download the completed notebook as HTML, and submit it on CMS.